<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>用户</title>
</head>
<body>
<%@include file="/html/common/top.jsp" %>
<%@include file="/html/common/menu.jsp" %>
<div id="right">
    <h2><a href="/html/user/Add.jsp">添加</a></h2>


    <form action="/user/list" method="post">

        姓名：<input name="username" type="text" value="${username}">
        <input type="submit" value="查询">

    </form>


    <table class="table table-bordered">
        <tr>
            <td>序号</td>
            <td>姓名</td>
            <td>邮箱</td>
            <td>真实姓名</td>
            <td>年龄</td>
            <td>性别</td>
            <td>注册时间</td>
            <td>操作</td>
        </tr>

        <c:forEach items="${list}" var="user" varStatus="status">
            <tr>
                <td>${status.index+1}</td>
                <td>${user.username}</td>
                <td>${user.email}</td>
                <td>${user.realName}</td>
                <td>${user.age}</td>
                <td>${user.sex}</td>
                <td>${user.registerTime}</td>
                <td>
                    <a href="/user/delete?id=${user.id}">删除</a>
                    <a href="/user/toUpdate?id=${user.id}">修改</a>
                </td>
            </tr>
        </c:forEach>
    </table>

    <%--<a href="/user/list?pageCurrent=1">第1页</a>--%>
    <%--<a href="/user/list?pageCurrent=2">第2页</a>--%>
    <%--<a href="/user/list?pageCurrent=3">第3页</a>--%>

    <a href="/user/list?pageCurrent=${name}">首页</a>
    <a href="/user/list?pageCurrent=${page.pageCurrent-1}&name${name}">上一页</a>
    <a href="/user/list?pageCurrent=${page.pageCurrent+1}&name${name}">下一页</a>
    <a href="/user/list?pageCurrent=${page.pageTotal}&name${name}">尾页</a>
    <%--第${page}页,共${count}条,共${pageCurrent}页--%>
    当前${page.pageCurrent}页,共${page.count}条,共${page.pageTotal}页
</div>

</body>
</html>